LanguageExt.Core

LanguageExt.Core DataTypes Immutable Collections List

Contents

interface ListInfo Source #

struct Lst <A> Source #

Immutable list

Parameters

type A

Value type

Fields

field Lst<A> Empty = new Lst<A>(new A[0] { }) Source #

Empty list

Indexers

this [ A ] Source #

Index accessor

Properties

property bool IsEmpty Source #

property object Case Source #

Reference version for use in pattern-matching

Empty collection     = null
Singleton collection = A
More                 = (A, Seq<A>)   -- head and tail

Example:

var res = list.Case switch
{

   A value         => ...,
   (var x, var xs) => ...,
   _               => ...
}

property Lens<Lst<A>, A> head Source #

Head lens

property Lens<Lst<A>, Option<A>> headOrNone Source #

Head or none lens

property Lens<Lst<A>, A> tail Source #

Tail lens

property Lens<Lst<A>, Option<A>> tailOrNone Source #

Tail or none lens

property int Count Source #

Number of items in the list

Constructors

constructor Lst (IEnumerable<A> initial) Source #

Ctor

Methods

method Lens<Lst<A>, A> item (int index) Source #

Item at index lens

method Lens<Lst<A>, Option<A>> itemOrNone (int index) Source #

Item or none at index lens

method Lens<Lst<A>, Lst<B>> map <B> (Lens<A, B> lens) Source #

Lens map

method bool Contains (A value) Source #

Find if a value is in the collection

Parameters

param value

Value to test

returns

True if collection contains value

method bool Contains <EqA> (A value) Source #

where EqA : struct, Eq<A>

Contains with provided Eq class instance

Parameters

type EqA

Eq class instance

param value

Value to test

returns

True if collection contains value

method Lst<A> Add (A value) Source #

Add an item to the end of the list

method Lst<A> AddRange (IEnumerable<A> items) Source #

Add a range of items to the end of the list

method Lst<A> Clear () Source #

Clear the list

method ListEnumerator<A> GetEnumerator () Source #

Get enumerator

method int IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the index of an item

method Lst<A> Insert (int index, A value) Source #

Insert value at specified index

method Lst<A> InsertRange (int index, IEnumerable<A> items) Source #

Insert range of values at specified index

method int LastIndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the last index of an item in the list

method Lst<A> Remove (A value) Source #

Remove all items that match the value from the list

method Lst<A> Remove (A value, IEqualityComparer<A> equalityComparer) Source #

Remove all items that match the value from the list

method Lst<A> RemoveAll (Func<A, bool> pred) Source #

Remove all items that match a predicate

method Lst<A> RemoveAt (int index) Source #

Remove item at location

Parameters

param index
returns

method Lst<A> RemoveRange (int index, int count) Source #

Remove a range of items

method Lst<A> SetItem (int index, A value) Source #

Set an item at the specified index

method IEnumerable<A> FindRange (int index, int count) Source #

Returns an enumerable range from the collection. This is the fastest way of iterating sub-ranges of the collection.

Parameters

param index

Index into the collection

param count

Number of items to find

returns

IEnumerable of items

method Seq<A> ToSeq () Source #

method string ToString () Source #

Format the collection as [a, b, c, ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as a, b, c, ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [a, b, c, ...]

method IEnumerable<A> AsEnumerable () Source #

method IEnumerable<A> Skip (int amount) Source #

method Lst<A> Reverse () Source #

Reverse the order of the items in the list

method S Fold <S> (S state, Func<S, A, S> folder) Source #

Fold

method Lst<A> Do (Action<A> f) Source #

Impure iteration of the bound values in the structure

Parameters

returns

Returns the original unmodified structure

method Lst<U> Map <U> (Func<A, U> map) Source #

Map

method Lst<A> Filter (Func<A, bool> pred) Source #

Filter

method Lst<A> Append (Lst<A> rhs) Source #

method Lst<A> Subtract (Lst<A> rhs) Source #

method bool Equals (object obj) Source #

method int GetHashCode () Source #

Get the hash code Lazily (and once only) calculates the hash from the elements in the list Empty list hash == 0

method int CompareTo (object obj) Source #

method bool Equals (Lst<A> other) Source #

method Arr<A> ToArray () Source #

method int CompareTo (Lst<A> other) Source #

Operators

operator + (Lst<A> lhs, A rhs) Source #

operator + (A lhs, Lst<A> rhs) Source #

operator + (Lst<A> lhs, Lst<A> rhs) Source #

operator - (Lst<A> lhs, Lst<A> rhs) Source #

operator == (Lst<A> lhs, Lst<A> rhs) Source #

operator != (Lst<A> lhs, Lst<A> rhs) Source #

operator < (Lst<A> lhs, Lst<A> rhs) Source #

operator <= (Lst<A> lhs, Lst<A> rhs) Source #

operator > (Lst<A> lhs, Lst<A> rhs) Source #

operator >= (Lst<A> lhs, Lst<A> rhs) Source #

class ListExtensions Source #

Methods

method Lst<A> Flatten <A> (this Lst<Lst<A>> ma) Source #

Monadic join

method IEnumerable<A> Flatten <A> (this IEnumerable<IEnumerable<A>> ma) Source #

Monadic join

method Seq<A> ToSeq <A> (this IEnumerable<A> enumerable) Source #

Converts an enumerable to a Seq

method Seq<A> ToSeq <A> (this IList<A> enumerable) Source #

Converts an enumerable to a Seq

method Seq<A> ToSeq <A> (this A[] array) Source #

Converts an array to a Seq

method IEnumerable<A> Append <A> (this IEnumerable<A> lhs, IEnumerable<A> rhs) Source #

Concatenate two enumerables (Concat in LINQ)

Parameters

type A

Enumerable item type

param lhs

First enumerable

param rhs

Second enumerable

returns

Concatenated enumerable

method B Match <A, B> (this IEnumerable<A> list, Func<B> Empty, Func<Seq<A>, B> More) Source #

Match empty list, or multi-item list

Parameters

type B

Return value type

param Empty

Match for an empty list

param More

Match for a non-empty

returns

Result of match function invoked

method B Match <A, B> (this IEnumerable<A> list, Func<B> Empty, Func<A, Seq<A>, B> More) Source #

List pattern matching

method R Match <T, R> (this IEnumerable<T> list, Func<R> Empty, Func<T, R> One, Func<T, Seq<T>, R> More ) Source #

List pattern matching

method T Head <T> (this IEnumerable<T> list) Source #

Get the item at the head (first) of the list

Parameters

param list

List

returns

Head item

method Option<T> HeadSafe <T> (this IEnumerable<T> list) Source #

method Option<T> HeadOrNone <T> (this IEnumerable<T> list) Source #

Get the item at the head (first) of the list or None if the list is empty

Parameters

param list

List

returns

Optional head item

method Either<L, R> HeadOrLeft <L, R> (this IEnumerable<R> list, L left) Source #

Get the item at the head (first) of the list or Left if the list is empty

Parameters

param list

List

returns

Either head item or left

method Validation<Fail, Success> HeadOrInvalid <Fail, Success> (this IEnumerable<Success> list, Fail fail) Source #

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method Validation<Fail, Success> HeadOrInvalid <Fail, Success> (this IEnumerable<Success> list, Seq<Fail> fail) Source #

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method Validation<MonoidFail, Fail, Success> HeadOrInvalid <MonoidFail, Fail, Success> (this IEnumerable<Success> list, Fail fail) Source #

where MonoidFail : struct, Monoid<Fail>, Eq<Fail>

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method Option<A> LastOrNone <A> (this IEnumerable<A> list) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Either<L, R> LastOrLeft <L, R> (this IEnumerable<R> list, L left) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<Fail, Success> LastOrInvalid <Fail, Success> (this IEnumerable<Success> list, Fail fail) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<Fail, Success> LastOrInvalid <Fail, Success> (this IEnumerable<Success> list, Seq<Fail> fail) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<MonoidFail, Fail, Success> LastOrInvalid <MonoidFail, Fail, Success> (this IEnumerable<Success> list, Fail fail) Source #

where MonoidFail : struct, Monoid<Fail>, Eq<Fail>

Get the last item of the list

Parameters

param list

List

returns

Last item

method Seq<A> Init <A> (this IEnumerable<A> list) Source #

Get all items in the list except the last one

Must evaluate the last item to know it's the last, but won't return it

Parameters

param list

List

returns

The initial items (all but the last)

method IEnumerable<T> Tail <T> (this IEnumerable<T> list) Source #

Get the tail of the list (skips the head item)

Parameters

param list

List

returns

Enumerable of T

method IEnumerable<B> Apply <A, B> (this IEnumerable<Func<A, B>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable of argument values

returns

Returns the result of applying the IEnumerable argument values to the IEnumerable functions

method IEnumerable<A> Intersperse <A> (this IEnumerable<A> ma, A value) Source #

Inject a value in between each item in the enumerable

Parameters

type A

Bound type

param ma

Enumerable to inject values into

param value

Item to inject

returns

An enumerable with the values injected

method string Concat (this IEnumerable<string> xs) Source #

Concact all strings into one

method IEnumerable<B> Apply <A, B> (this Func<A, B> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable of argument values

returns

Returns the result of applying the IEnumerable argument values to the IEnumerable functions

method IEnumerable<Func<B, C>> Apply <A, B, C> (this IEnumerable<Func<A, B, C>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<Func<B, C>> Apply <A, B, C> (this Func<A, B, C> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<C> Apply <A, B, C> (this IEnumerable<Func<A, B, C>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<C> Apply <A, B, C> (this Func<A, B, C> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<Func<B, C>> Apply <A, B, C> (this IEnumerable<Func<A, Func<B, C>>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<Func<B, C>> Apply <A, B, C> (this Func<A, Func<B, C>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<C> Apply <A, B, C> (this IEnumerable<Func<A, Func<B, C>>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<C> Apply <A, B, C> (this Func<A, Func<B, C>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<B> Action <A, B> (this IEnumerable<A> fa, IEnumerable<B> fb) Source #

Evaluate fa, then fb, ignoring the result of fa

Parameters

param fa

Applicative to evaluate first

param fb

Applicative to evaluate second and then return

returns

Applicative of type FB derived from Applicative of B

method IEnumerable<R> Map <T, R> (this IEnumerable<T> list, Func<T, R> map) Source #

Projects the values in the enumerable using a map function into a new enumerable (Select in LINQ).

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method IEnumerable<R> Map <T, R> (this IEnumerable<T> list, Func<int, T, R> map) Source #

Projects the values in the enumerable using a map function into a new enumerable (Select in LINQ).

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method IEnumerable<Func<T2, R>> ParMap <T1, T2, R> (this IEnumerable<T1> list, Func<T1, T2, R> func) Source #

Partial application map

method IEnumerable<Func<T2, Func<T3, R>>> ParMap <T1, T2, T3, R> (this IEnumerable<T1> list, Func<T1, T2, T3, R> func) Source #

Partial application map

method IEnumerable<T> Filter <T> (this IEnumerable<T> list, Func<T, bool> predicate) Source #

Removes items from the list that do not match the given predicate (Where in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to filter

param predicate

Predicate function

returns

Filtered enumerable

method IEnumerable<R> Choose <T, R> (this IEnumerable<T> list, Func<T, Option<R>> selector) Source #

Applies the given function 'selector' to each element of the list. Returns the list comprised of the results for each element where the function returns Some(f(x)).

Parameters

type T

Enumerable item type

param list

Enumerable

param selector

Selector function

returns

Mapped and filtered enumerable

method IEnumerable<R> Choose <T, R> (this IEnumerable<T> list, Func<int, T, Option<R>> selector) Source #

Applies the given function 'selector' to each element of the list. Returns the list comprised of the results for each element where the function returns Some(f(x)).

Parameters

type T

Enumerable item type

param list

Enumerable

param selector

Selector function

returns

Mapped and filtered enumerable

method IEnumerable<R> Collect <T, R> (this IEnumerable<T> list, Func<T, IEnumerable<R>> map) Source #

For each element of the list, applies the given function. Concatenates all the results and returns the combined list.

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method IEnumerable<T> Rev <T> (this IEnumerable<T> list) Source #

Reverses the enumerable (Reverse in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to reverse

returns

Reversed enumerable

method Lst<A> Rev <A> (this Lst<A> list) Source #

Reverses the list (Reverse in LINQ)

Parameters

type A

List item type

param list

Listto reverse

returns

Reversed list

method Lst<PredList, A> Rev <PredList, A> (this Lst<PredList, A> list) Source #

where PredList : struct, Pred<ListInfo>

Reverses the list (Reverse in LINQ)

Parameters

type A

List item type

param list

Listto reverse

returns

Reversed list

method Lst<PredList, PredItem, A> Rev <PredList, PredItem, A> (this Lst<PredList, PredItem, A> list) Source #

where PredList : struct, Pred<ListInfo>
where PredItem : struct, Pred<A>

Reverses the list (Reverse in LINQ)

Parameters

type A

List item type

param list

Listto reverse

returns

Reversed list

method S Fold <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result. (Aggregate in LINQ)

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

returns

Aggregate value

method S FoldBack <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

returns

Aggregate value

method S FoldWhile <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection whilst the predicate function returns True for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S FoldWhile <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation (and whilst the predicate function returns True when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S FoldBackWhile <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection (from last element to first) whilst the predicate function returns True for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S FoldBackWhile <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an accumulator argument through the computation (and whilst the predicate function returns True when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S FoldUntil <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection whilst the predicate function returns False for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S FoldUntil <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation (and whilst the predicate function returns False when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S FoldBackUntil <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection (from last element to first) whilst the predicate function returns False for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S FoldBackUntil <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an accumulator argument through the computation (and whilst the predicate function returns False when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method T Reduce <T> (this IEnumerable<T> list, Func<T, T, T> reducer) Source #

Applies a function to each element of the collection (from last element to first), threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

Parameters

type T

Enumerable item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Aggregate value

method T ReduceBack <T> (this IEnumerable<T> list, Func<T, T, T> reducer) Source #

Applies a function to each element of the collection, threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

Parameters

type T

Enumerable item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Aggregate value

method IEnumerable<S> Scan <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function to each element of the collection, threading an accumulator argument through the computation. This function takes the state argument, and applies the function to it and the first element of the list. Then, it passes this result into the function along with the second element, and so on. Finally, it returns the list of intermediate results and the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Folding function

returns

Aggregate state

method IEnumerable<S> ScanBack <S, T> (this IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function to each element of the collection (from last element to first), threading an accumulator argument through the computation. This function takes the state argument, and applies the function to it and the first element of the list. Then, it passes this result into the function along with the second element, and so on. Finally, it returns the list of intermediate results and the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Folding function

returns

Aggregate state

method IEnumerable<(T, U)> Zip <T, U> (this IEnumerable<T> list, IEnumerable<U> other) Source #

Joins two enumerables together either into a single enumerable of tuples

Parameters

param list

First list to join

param other

Second list to join

param zipper

Join function

returns

Joined enumerable

method Option<T> Find <T> (this IEnumerable<T> list, Func<T, bool> pred) Source #

Returns Some(x) for the first item in the list that matches the predicate provided, None otherwise.

Parameters

type T

Enumerable item type

param list

Enumerable to search

param pred

Predicate

returns

Some(x) for the first item in the list that matches the predicate provided, None otherwise.

method IEnumerable<T> FindSeq <T> (this IEnumerable<T> list, Func<T, bool> pred) Source #

Returns [x] for the first item in the list that matches the predicate provided, [] otherwise.

Parameters

type T

Enumerable item type

param list

Enumerable to search

param pred

Predicate

returns

[x] for the first item in the list that matches the predicate provided, [] otherwise.

method Lst<T> Freeze <T> (this IEnumerable<T> list) Source #

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method Lst<PredList, T> Freeze <PredList, T> (this IEnumerable<T> list) Source #

where PredList : struct, Pred<ListInfo>

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method Lst<PredList, PredItem, T> Freeze <PredList, PredItem, T> (this IEnumerable<T> list) Source #

where PredItem : struct, Pred<T>
where PredList : struct, Pred<ListInfo>

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method Arr<A> ToArr <A> (this IEnumerable<A> list) Source #

Convert the enumerable to an immutable array

method int Length <T> (this IEnumerable<T> list) Source #

Returns the number of items in the Lst T

Parameters

type T

Item type

param list

List to count

returns

The number of items in the list

method Unit Iter <T> (this IEnumerable<T> list, Action<T> action) Source #

Invokes an action for each item in the enumerable in order

Parameters

type T

Enumerable item type

param list

Enumerable to iterate

param action

Action to invoke with each item

returns

Unit

method Unit Iter <T> (this IEnumerable<T> list, Action<int, T> action) Source #

Invokes an action for each item in the enumerable in order

Parameters

type T

Enumerable item type

param list

Enumerable to iterate

param action

Action to invoke with each item

returns

Unit

method Unit Consume <T> (this IEnumerable<T> list) Source #

Iterate each item in the enumerable in order (consume items)

Parameters

type T

Enumerable item type

param list

Enumerable to consume

returns

Unit

method bool ForAll <T> (this IEnumerable<T> list, Func<T, bool> pred) Source #

Returns true if all items in the enumerable match a predicate (Any in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to test

param pred

Predicate

returns

True if all items in the enumerable match the predicate

method IEnumerable<T> Distinct <EQ, T> (this IEnumerable<T> list) Source #

where EQ : struct, Eq<T>

Return a new enumerable with all duplicate values removed

Parameters

type T

Enumerable item type

param list

Enumerable

returns

A new enumerable with all duplicate values removed

method bool Exists <T> (this IEnumerable<T> list, Func<T, bool> pred) Source #

Returns true if any item in the enumerable matches the predicate provided

Parameters

type T

Enumerable item type

param list

Enumerable to test

param pred

Predicate

returns

True if any item in the enumerable matches the predicate provided

method IEnumerable<IEnumerable<T>> Tails <T> (this IEnumerable<T> self) Source #

The tails function returns all final segments of the argument, longest first. For example, i.e. tails(['a','b','c']) == [['a','b','c'], ['b','c'], ['c'],[]]

Parameters

type T

List item type

param self

List

returns

Enumerable of Enumerables of T

method (IEnumerable<T>, IEnumerable<T>) Span <T> (this IEnumerable<T> self, Func<T, bool> pred) Source #

Span, applied to a predicate 'pred' and a list, returns a tuple where first element is longest prefix (possibly empty) of elements that satisfy 'pred' and second element is the remainder of the list:

Parameters

type T

List element type

param self

List

param pred

Predicate

returns

Split list

Examples

List.span(List(1,2,3,4,1,2,3,4), x => x < 3) == (List(1,2),List(3,4,1,2,3,4))

List.span(List(1,2,3), x => x < 9) == (List(1,2,3),List())

List.span(List(1,2,3), x => x < 0) == (List(),List(1,2,3))

method IEnumerable<R> Bind <T, R> (this IEnumerable<T> self, Func<T, IEnumerable<R>> binder) Source #

Monadic bind function for IEnumerable

method Lst<B> Select <A, B> (this Lst<A> self, Func<A, B> map) Source #

LINQ Select implementation for Lst

method Lst<PredList, B> Select <PredList, A, B> (this Lst<PredList, A> self, Func<A, B> map) Source #

where PredList : struct, Pred<ListInfo>

LINQ Select implementation for Lst

method IEnumerable<B> BindEnumerable <A, B> (this Lst<A> self, Func<A, Lst<B>> binder) Source #

Monadic bind function for Lst that returns an IEnumerable

method IEnumerable<B> BindEnumerable <PredList, A, B> (this Lst<PredList, A> self, Func<A, Lst<PredList, B>> binder) Source #

where PredList : struct, Pred<ListInfo>

Monadic bind function for Lst that returns an IEnumerable

method IEnumerable<B> BindEnumerable <PredList, PredItemA, PredItemB, A, B> (this Lst<PredList, PredItemA, A> self, Func<A, Lst<PredList, PredItemB, B>> binder) Source #

where PredList : struct, Pred<ListInfo>
where PredItemA : struct, Pred<A>
where PredItemB : struct, Pred<B>

Monadic bind function for Lst that returns an IEnumerable

method Lst<B> Bind <A, B> (this Lst<A> self, Func<A, Lst<B>> binder) Source #

Monadic bind function

method Lst<PredList, B> Bind <PredList, A, B> (this Lst<PredList, A> self, Func<A, Lst<PredList, B>> binder) Source #

where PredList : struct, Pred<ListInfo>

Monadic bind function

method Lst<PredList, PredItemB, B> Bind <PredList, PredItemA, PredItemB, A, B> (this Lst<PredList, PredItemA, A> self, Func<A, Lst<PredList, PredItemB, B>> binder) Source #

where PredList : struct, Pred<ListInfo>
where PredItemA : struct, Pred<A>
where PredItemB : struct, Pred<B>

Monadic bind function

method int Count <A> (this Lst<A> self) Source #

Returns the number of items in the Lst T

Parameters

type A

Item type

param list

List to count

returns

The number of items in the list

method int Count <PredList, A> (this Lst<PredList, A> self) Source #

where PredList : struct, Pred<ListInfo>

Returns the number of items in the Lst T

Parameters

type A

Item type

param list

List to count

returns

The number of items in the list

method int Count <PredList, PredItem, A> (this Lst<PredList, PredItem, A> self) Source #

where PredList : struct, Pred<ListInfo>
where PredItem : struct, Pred<A>

Returns the number of items in the Lst T

Parameters

type A

Item type

param list

List to count

returns

The number of items in the list

method Lst<C> SelectMany <A, B, C> (this Lst<A> self, Func<A, Lst<B>> bind, Func<A, B, C> project) Source #

LINQ bind implementation for Lst

method Lst<PredList, C> SelectMany <PredList, A, B, C> (this Lst<PredList, A> self, Func<A, Lst<PredList, B>> bind, Func<A, B, C> project) Source #

where PredList : struct, Pred<ListInfo>

LINQ bind implementation for Lst

method IEnumerable<T> SkipLast <T> (this IEnumerable<T> self) Source #

Take all but the last item in an enumerable

Parameters

type T

Bound value type

method IEnumerable<T> SkipLast <T> (this IEnumerable<T> self, int n) Source #

Take all but the last n items in an enumerable

Parameters

type T

Bound value type

method Option<A> ToOption <A> (this IEnumerable<A> self) Source #

Convert the enumerable to an Option.

Parameters

type A

Bound value type

param self

This

returns

If enumerable is empty then return None, else Some(head)

method TryOption<A> ToTryOption <A> (this IEnumerable<A> self) Source #

Convert the enumerable to an Option.

Parameters

type A

Bound value type

param self

This

returns

If enumerable is empty then return None, else Some(head)

method TAccumulate Aggregate <TSource, TAccumulate> (this Lst<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func) Source #

Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.

method TResult Aggregate <TSource, TAccumulate, TResult> (this Lst<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector) Source #

Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value.

method TSource Aggregate <TSource> (this Lst<TSource> source, Func<TSource, TSource, TSource> func) Source #

Applies an accumulator function over a sequence.

method bool All <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Determines whether all elements of a sequence satisfy a condition.

method bool Any <TSource> (this Lst<TSource> source) Source #

Determines whether a sequence contains any elements.

method bool Any <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Determines whether any element of a sequence satisfies a condition.

method IEnumerable<TSource> AsEnumerable <TSource> (this Lst<TSource> source) Source #

Returns the input typed as IEnumerable.

method IQueryable<TElement> AsQueryable <TElement> (this Lst<TElement> source) Source #

Converts a generic IEnumerable to a generic IQueryable.

method decimal Average (this Lst<decimal> source) Source #

Computes the average of a sequence of Decimal values.

method decimal Average <TSource> (this Lst<TSource> source, Func<TSource, decimal> selector) Source #

Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method decimal? Average (this Lst<decimal?> source) Source #

Computes the average of a sequence of nullable Decimal values.

method decimal? Average <TSource> (this Lst<TSource> source, Func<TSource, decimal?> selector) Source #

Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method double Average (this Lst<double> source) Source #

Computes the average of a sequence of Double values.

method double Average (this Lst<int> source) Source #

Computes the average of a sequence of Int32 values.

method double Average (this Lst<long> source) Source #

Computes the average of a sequence of Int64 values.

method double Average <TSource> (this Lst<TSource> source, Func<TSource, double> selector) Source #

Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.

method double Average <TSource> (this Lst<TSource> source, Func<TSource, int> selector) Source #

Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method double Average <TSource> (this Lst<TSource> source, Func<TSource, long> selector) Source #

Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average (this Lst<double?> source) Source #

Computes the average of a sequence of nullable Double values.

method double? Average (this Lst<int?> source) Source #

Computes the average of a sequence of nullable Int32 values.

method double? Average (this Lst<long?> source) Source #

Computes the average of a sequence of nullable Int64 values.

method double? Average <TSource> (this Lst<TSource> source, Func<TSource, double?> selector) Source #

Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average <TSource> (this Lst<TSource> source, Func<TSource, int?> selector) Source #

Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method double? Average <TSource> (this Lst<TSource> source, Func<TSource, long?> selector) Source #

Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method float Average (this Lst<float> source) Source #

Computes the average of a sequence of Single values.

method float Average <TSource> (this Lst<TSource> source, Func<TSource, float> selector) Source #

Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.

method float? Average (this Lst<float?> source) Source #

Computes the average of a sequence of nullable Single values.

method float? Average <TSource> (this Lst<TSource> source, Func<TSource, float?> selector) Source #

Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.

method IEnumerable<TSource> Concat <TSource> (this Lst<TSource> first, IEnumerable<TSource> second) Source #

Concatenates two sequences.

method bool Contains <TSource> (this Lst<TSource> source, TSource value) Source #

Determines whether a sequence contains a specified element by using the default equality comparer.

method bool Contains <TSource> (this Lst<TSource> source, TSource value, IEqualityComparer<TSource> comparer) Source #

Determines whether a sequence contains a specified element by using a specified IEqualityComparer.

method int Count <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns a number that represents how many elements in the specified sequence satisfy a condition.

method IEnumerable<TSource> DefaultIfEmpty <TSource> (this Lst<TSource> source) Source #

Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.

method IEnumerable<TSource> DefaultIfEmpty <TSource> (this Lst<TSource> source, TSource defaultValue) Source #

Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.

method IEnumerable<TSource> Distinct <TSource> (this Lst<TSource> source) Source #

Returns distinct elements from a sequence by using the default equality comparer to compare values.

method IEnumerable<TSource> Distinct <TSource> (this Lst<TSource> source, IEqualityComparer<TSource> comparer) Source #

Returns distinct elements from a sequence by using a specified IEqualityComparer to compare values.

method TSource ElementAt <TSource> (this Lst<TSource> source, int index) Source #

Returns the element at a specified index in a sequence.

method TSource ElementAtOrDefault <TSource> (this Lst<TSource> source, int index) Source #

Returns the element at a specified index in a sequence or a default value if the index is out of range.

method IEnumerable<TSource> Except <TSource> (this Lst<TSource> first, IEnumerable<TSource> second) Source #

Produces the set difference of two sequences by using the default equality comparer to compare values.

method IEnumerable<TSource> Except <TSource> (this Lst<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set difference of two sequences by using the specified IEqualityComparer to compare values.

method TSource First <TSource> (this Lst<TSource> source) Source #

Returns the first element of a sequence.

method TSource First <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the first element in a sequence that satisfies a specified condition.

method TSource FirstOrDefault <TSource> (this Lst<TSource> source) Source #

Returns the first element of a sequence, or a default value if the sequence contains no elements.

method TSource FirstOrDefault <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

method IEnumerable<IGrouping<TKey, TElement>> GroupBy <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function.

method IEnumerable<IGrouping<TKey, TElement>> GroupBy <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.

method IEnumerable<IGrouping<TKey, TSource>> GroupBy <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector) Source #

Groups the elements of a sequence according to a specified key selector function.

method IEnumerable<IGrouping<TKey, TSource>> GroupBy <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.

method IEnumerable<TResult> GroupBy <TSource, TKey, TElement, TResult> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function.

method IEnumerable<TResult> GroupBy <TSource, TKey, TElement, TResult> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.

method IEnumerable<TResult> GroupBy <TSource, TKey, TResult> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

method IEnumerable<TResult> GroupBy <TSource, TKey, TResult> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer.

method IEnumerable<TResult> GroupJoin <TOuter, TInner, TKey, TResult> (this Lst<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector) Source #

Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.

method IEnumerable<TResult> GroupJoin <TOuter, TInner, TKey, TResult> (this Lst<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, IEnumerable<TInner>, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer is used to compare keys.

method IEnumerable<TSource> Intersect <TSource> (this Lst<TSource> first, IEnumerable<TSource> second) Source #

Produces the set intersection of two sequences by using the default equality comparer to compare values.

method IEnumerable<TSource> Intersect <TSource> (this Lst<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set intersection of two sequences by using the specified IEqualityComparer to compare values.

method IEnumerable<TResult> Join <TOuter, TInner, TKey, TResult> (this Lst<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector) Source #

Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.

method IEnumerable<TResult> Join <TOuter, TInner, TKey, TResult> (this Lst<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer) Source #

Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer is used to compare keys.

method TSource Last <TSource> (this Lst<TSource> source) Source #

Returns the last element of a sequence.

method TSource Last <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the last element of a sequence that satisfies a specified condition.

method TSource LastOrDefault <TSource> (this Lst<TSource> source) Source #

Returns the last element of a sequence, or a default value if the sequence contains no elements.

method TSource LastOrDefault <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.

method long LongCount <TSource> (this Lst<TSource> source) Source #

Returns an Int64 that represents the total number of elements in a sequence.

method long LongCount <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns an Int64 that represents how many elements in a sequence satisfy a condition.

method decimal Max (this Lst<decimal> source) Source #

Returns the maximum value in a sequence of Decimal values.

method decimal Max <TSource> (this Lst<TSource> source, Func<TSource, decimal> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Decimal value.

method decimal? Max (this Lst<decimal?> source) Source #

Returns the maximum value in a sequence of nullable Decimal values.

method decimal? Max <TSource> (this Lst<TSource> source, Func<TSource, decimal?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value.

method double Max (this Lst<double> source) Source #

Returns the maximum value in a sequence of Double values.

method double Max <TSource> (this Lst<TSource> source, Func<TSource, double> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Double value.

method double? Max (this Lst<double?> source) Source #

Returns the maximum value in a sequence of nullable Double values.

method double? Max <TSource> (this Lst<TSource> source, Func<TSource, double?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Double value.

method float Max (this Lst<float> source) Source #

Returns the maximum value in a sequence of Single values.

method float Max <TSource> (this Lst<TSource> source, Func<TSource, float> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Single value.

method float? Max (this Lst<float?> source) Source #

Returns the maximum value in a sequence of nullable Single values.

method float? Max <TSource> (this Lst<TSource> source, Func<TSource, float?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Single value.

method int Max (this Lst<int> source) Source #

Returns the maximum value in a sequence of Int32 values.

method int Max <TSource> (this Lst<TSource> source, Func<TSource, int> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Int32 value.

method int? Max (this Lst<int?> source) Source #

Returns the maximum value in a sequence of nullable Int32 values.

method int? Max <TSource> (this Lst<TSource> source, Func<TSource, int?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value.

method long Max (this Lst<long> source) Source #

Returns the maximum value in a sequence of Int64 values.

method long Max <TSource> (this Lst<TSource> source, Func<TSource, long> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum Int64 value.

method long? Max (this Lst<long?> source) Source #

Returns the maximum value in a sequence of nullable Int64 values.

method long? Max <TSource> (this Lst<TSource> source, Func<TSource, long?> selector) Source #

Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value.

method TResult Max <TSource, TResult> (this Lst<TSource> source, Func<TSource, TResult> selector) Source #

Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.

method TSource Max <TSource> (this Lst<TSource> source) Source #

Returns the maximum value in a generic sequence.

method decimal Min (this Lst<decimal> source) Source #

Returns the minimum value in a sequence of Decimal values.

method decimal Min <TSource> (this Lst<TSource> source, Func<TSource, decimal> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Decimal value.

method decimal? Min (this Lst<decimal?> source) Source #

Returns the minimum value in a sequence of nullable Decimal values.

method decimal? Min <TSource> (this Lst<TSource> source, Func<TSource, decimal?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.

method double Min (this Lst<double> source) Source #

Returns the minimum value in a sequence of Double values.

method double Min <TSource> (this Lst<TSource> source, Func<TSource, double> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Double value.

method double? Min (this Lst<double?> source) Source #

Returns the minimum value in a sequence of nullable Double values.

method double? Min <TSource> (this Lst<TSource> source, Func<TSource, double?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.

method float Min (this Lst<float> source) Source #

Returns the minimum value in a sequence of Single values.

method float Min <TSource> (this Lst<TSource> source, Func<TSource, float> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Single value.

method float? Min (this Lst<float?> source) Source #

Returns the minimum value in a sequence of nullable Single values.

method float? Min <TSource> (this Lst<TSource> source, Func<TSource, float?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Single value.

method int Min (this Lst<int> source) Source #

Returns the minimum value in a sequence of Int32 values.

method int Min <TSource> (this Lst<TSource> source, Func<TSource, int> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Int32 value.

method int? Min (this Lst<int?> source) Source #

Returns the minimum value in a sequence of nullable Int32 values.

method int? Min <TSource> (this Lst<TSource> source, Func<TSource, int?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value.

method long Min (this Lst<long> source) Source #

Returns the minimum value in a sequence of Int64 values.

method long Min <TSource> (this Lst<TSource> source, Func<TSource, long> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum Int64 value.

method long? Min (this Lst<long?> source) Source #

Returns the minimum value in a sequence of nullable Int64 values.

method long? Min <TSource> (this Lst<TSource> source, Func<TSource, long?> selector) Source #

Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value.

method TResult Min <TSource, TResult> (this Lst<TSource> source, Func<TSource, TResult> selector) Source #

Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.

method TSource Min <TSource> (this Lst<TSource> source) Source #

Returns the minimum value in a generic sequence.

method IOrderedEnumerable<TSource> OrderBy <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector) Source #

Sorts the elements of a sequence in ascending order according to a key.

method IOrderedEnumerable<TSource> OrderBy <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer) Source #

Sorts the elements of a sequence in ascending order by using a specified comparer.

method IOrderedEnumerable<TSource> OrderByDescending <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector) Source #

Sorts the elements of a sequence in descending order according to a key.

method IOrderedEnumerable<TSource> OrderByDescending <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer) Source #

Sorts the elements of a sequence in descending order by using a specified comparer.

method IEnumerable<TSource> Reverse <TSource> (this Lst<TSource> source) Source #

Inverts the order of the elements in a sequence.

method bool SequenceEqual <TSource> (this Lst<TSource> first, IEnumerable<TSource> second) Source #

Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.

method bool SequenceEqual <TSource> (this Lst<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer.

method TSource Single <TSource> (this Lst<TSource> source) Source #

Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

method TSource Single <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

method TSource SingleOrDefault <TSource> (this Lst<TSource> source) Source #

Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

method TSource SingleOrDefault <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

method IEnumerable<TSource> Skip <TSource> (this Lst<TSource> source, int count) Source #

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

method IEnumerable<TSource> SkipWhile <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.

method IEnumerable<TSource> SkipWhile <TSource> (this Lst<TSource> source, Func<TSource, int, bool> predicate) Source #

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function.

method decimal Sum (this Lst<decimal> source) Source #

Computes the sum of a sequence of Decimal values.

method decimal Sum <TSource> (this Lst<TSource> source, Func<TSource, decimal> selector) Source #

Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method decimal? Sum (this Lst<decimal?> source) Source #

Computes the sum of a sequence of nullable Decimal values.

method decimal? Sum <TSource> (this Lst<TSource> source, Func<TSource, decimal?> selector) Source #

Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence.

method double Sum (this Lst<double> source) Source #

Computes the sum of a sequence of Double values.

method double Sum <TSource> (this Lst<TSource> source, Func<TSource, double> selector) Source #

Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence.

method double? Sum (this Lst<double?> source) Source #

Computes the sum of a sequence of nullable Double values.

method double? Sum <TSource> (this Lst<TSource> source, Func<TSource, double?> selector) Source #

Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence.

method float Sum (this Lst<float> source) Source #

Computes the sum of a sequence of Single values.

method float Sum <TSource> (this Lst<TSource> source, Func<TSource, float> selector) Source #

Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence.

method float? Sum (this Lst<float?> source) Source #

Computes the sum of a sequence of nullable Single values.

method float? Sum <TSource> (this Lst<TSource> source, Func<TSource, float?> selector) Source #

Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence.

method int Sum (this Lst<int> source) Source #

Computes the sum of a sequence of Int32 values.

method int Sum <TSource> (this Lst<TSource> source, Func<TSource, int> selector) Source #

Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method int? Sum (this Lst<int?> source) Source #

Computes the sum of a sequence of nullable Int32 values.

method int? Sum <TSource> (this Lst<TSource> source, Func<TSource, int?> selector) Source #

Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence.

method long Sum (this Lst<long> source) Source #

Computes the sum of a sequence of Int64 values.

method long Sum <TSource> (this Lst<TSource> source, Func<TSource, long> selector) Source #

Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method long? Sum (this Lst<long?> source) Source #

Computes the sum of a sequence of nullable Int64 values.

method long? Sum <TSource> (this Lst<TSource> source, Func<TSource, long?> selector) Source #

Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence.

method IEnumerable<TSource> Take <TSource> (this Lst<TSource> source, int count) Source #

Returns a specified number of contiguous elements from the start of a sequence.

method IEnumerable<TSource> TakeWhile <TSource> (this Lst<TSource> source, Func<TSource, bool> predicate) Source #

Returns elements from a sequence as long as a specified condition is true.

method IEnumerable<TSource> TakeWhile <TSource> (this Lst<TSource> source, Func<TSource, int, bool> predicate) Source #

Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.

method TSource[] ToArray <TSource> (this Lst<TSource> source) Source #

Creates an array from a IEnumerable.

method Dictionary<TKey, TElement> ToDictionary <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to specified key selector and element selector functions.

method Dictionary<TKey, TElement> ToDictionary <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function, a comparer, and an element selector function.

method Dictionary<TKey, TSource> ToDictionary <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function.

method Dictionary<TKey, TSource> ToDictionary <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Creates a Dictionary<TKey,TValue> from an IEnumerable according to a specified key selector function and key comparer.

method List<TSource> ToList <TSource> (this Lst<TSource> source) Source #

Creates a List from an IEnumerable.

method ILookup<TKey, TElement> ToLookup <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to specified key selector and element selector functions.

method ILookup<TKey, TElement> ToLookup <TSource, TKey, TElement> (this Lst<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function, a comparer and an element selector function.

method ILookup<TKey, TSource> ToLookup <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function.

method ILookup<TKey, TSource> ToLookup <TSource, TKey> (this Lst<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) Source #

Creates a Lookup<TKey,TElement> from an IEnumerable according to a specified key selector function and key comparer.

method IEnumerable<TSource> Union <TSource> (this Lst<TSource> first, IEnumerable<TSource> second) Source #

Produces the set union of two sequences by using the default equality comparer.

method IEnumerable<TSource> Union <TSource> (this Lst<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer) Source #

Produces the set union of two sequences by using a specified IEqualityComparer.

method IEnumerable<TResult> Zip <TFirst, TSecond, TResult> (this Lst<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector) Source #

Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.

struct ListEnumerator <T> Source #

Properties

property T Current Source #

Methods

method void Dispose () Source #

method bool MoveNext () Source #

method void Reset () Source #

class List Source #

Methods

method Lst<A> flatten <A> (Lst<Lst<A>> ma) Source #

Monadic join

method IEnumerable<A> flatten <A> (IEnumerable<IEnumerable<A>> ma) Source #

Monadic join

method Lst<T> empty <T> () Source #

Create an empty IEnumerable T

method Lst<T> create <T> () Source #

Create a new empty list

Parameters

returns

Lst T

method Lst<T> create <T> (params T[] items) Source #

Create a list from a initial set of items

Parameters

param items

Items

returns

Lst T

method Lst<T> createRange <T> (IEnumerable<T> items) Source #

Create a list from an initial set of items

Parameters

param items

Items

returns

Lst T

method IEnumerable<T> generate <T> (int count, Func<int, T> generator) Source #

Generates a sequence of T using the provided delegate to initialise each item.

method IEnumerable<T> generate <T> (Func<int, T> generator) Source #

Generates an int.MaxValue sequence of T using the provided delegate to initialise each item.

method IEnumerable<T> repeat <T> (T item, int count) Source #

Generates a sequence that contains one repeated value.

method Lst<T> add <T> (Lst<T> list, T value) Source #

Add an item to the list

Parameters

param list

List

param value

Item to add

returns

A new Lst T

method Lst<T> addRange <T> (Lst<T> list, IEnumerable<T> value) Source #

Add a range of items to the list

Parameters

param list

List

param value

Items to add

returns

A new Lst T

method Lst<T> remove <T> (Lst<T> list, T value) Source #

Remove an item from the list

Parameters

param list

List

param value

value to remove

returns

A new Lst T

method Lst<T> removeAt <T> (Lst<T> list, int index) Source #

Remove an item at a specified index in the list

Parameters

param list

List

param index

Index of item to remove

returns

A new Lst T

method T head <T> (IEnumerable<T> list) Source #

Get the item at the head (first) of the list

Parameters

param list

List

returns

Head item

method Option<A> headOrNone <A> (IEnumerable<A> list) Source #

Get the item at the head (first) of the list or None if the list is empty

Parameters

param list

List

returns

Optional head item

method Either<L, R> headOrLeft <L, R> (IEnumerable<R> list, L left) Source #

Get the item at the head (first) of the list or Left if the list is empty

Parameters

param list

List

returns

Either head item or left

method Validation<Fail, Success> headOrInvalid <Fail, Success> (IEnumerable<Success> list, Fail fail) Source #

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method Validation<Fail, Success> headOrInvalid <Fail, Success> (IEnumerable<Success> list, Seq<Fail> fail) Source #

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method Validation<MonoidFail, Fail, Success> headOrInvalid <MonoidFail, Fail, Success> (IEnumerable<Success> list, Fail fail) Source #

where MonoidFail : struct, Monoid<Fail>, Eq<Fail>

Get the item at the head (first) of the list or fail if the list is empty

Parameters

param list

List

returns

Either head item or fail

method A last <A> (IEnumerable<A> list) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Option<A> lastOrNone <A> (IEnumerable<A> list) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Either<L, R> lastOrLeft <L, R> (IEnumerable<R> list, L left) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<Fail, Success> lastOrInvalid <Fail, Success> (IEnumerable<Success> list, Fail fail) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<Fail, Success> lastOrInvalid <Fail, Success> (IEnumerable<Success> list, Seq<Fail> fail) Source #

Get the last item of the list

Parameters

param list

List

returns

Last item

method Validation<MonoidFail, Fail, Success> lastOrInvalid <MonoidFail, Fail, Success> (IEnumerable<Success> list, Fail fail) Source #

where MonoidFail : struct, Monoid<Fail>, Eq<Fail>

Get the last item of the list

Parameters

param list

List

returns

Last item

method Seq<A> init <A> (IEnumerable<A> list) Source #

Get all items in the list except the last one

Must evaluate the last item to know it's the last, but won't return it

Parameters

param list

List

returns

The initial items (all but the last)

method IEnumerable<T> tail <T> (IEnumerable<T> list) Source #

Get the tail of the list (skips the head item)

Parameters

param list

List

returns

Enumerable of T

method IEnumerable<R> map <T, R> (IEnumerable<T> list, Func<T, R> map) Source #

Projects the values in the enumerable using a map function into a new enumerable (Select in LINQ).

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method IEnumerable<Func<T2, R>> parmap <T1, T2, R> (IEnumerable<T1> list, Func<T1, T2, R> func) Source #

Partial application map

method IEnumerable<Func<T2, Func<T3, R>>> parmap <T1, T2, T3, R> (IEnumerable<T1> list, Func<T1, T2, T3, R> func) Source #

Partial application map

method IEnumerable<R> map <T, R> (IEnumerable<T> list, Func<int, T, R> map) Source #

Projects the values in the enumerable using a map function into a new enumerable (Select in LINQ). An index value is passed through to the map function also.

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method IEnumerable<T> filter <T> (IEnumerable<T> list, Func<T, bool> predicate) Source #

Removes items from the list that do not match the given predicate (Where in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to filter

param predicate

Predicate function

returns

Filtered enumerable

method IEnumerable<R> choose <T, R> (IEnumerable<T> list, Func<T, Option<R>> selector) Source #

Applies the given function 'selector' to each element of the list. Returns the list comprised of the results for each element where the function returns Some(f(x)).

Parameters

type T

Enumerable item type

param list

Enumerable

param selector

Selector function

returns

Mapped and filtered enumerable

method IEnumerable<R> choose <T, R> (IEnumerable<T> list, Func<int, T, Option<R>> selector) Source #

Applies the given function 'selector' to each element of the list. Returns the list comprised of the results for each element where the function returns Some(f(x)). An index value is passed through to the selector function also.

Parameters

type T

Enumerable item type

param list

Enumerable

param selector

Selector function

returns

Mapped and filtered enumerable

method IEnumerable<R> collect <T, R> (IEnumerable<T> list, Func<T, IEnumerable<R>> map) Source #

For each element of the list, applies the given function. Concatenates all the results and returns the combined list.

Parameters

type T

Enumerable item type

type R

Return enumerable item type

param list

Enumerable to map

param map

Map function

returns

Mapped enumerable

method int sum (IEnumerable<int> list) Source #

Returns the sum total of all the items in the list (Sum in LINQ)

Parameters

param list

List to sum

returns

Sum total

method float sum (IEnumerable<float> list) Source #

Returns the sum total of all the items in the list (Sum in LINQ)

Parameters

param list

List to sum

returns

Sum total

method double sum (IEnumerable<double> list) Source #

Returns the sum total of all the items in the list (Sum in LINQ)

Parameters

param list

List to sum

returns

Sum total

method decimal sum (IEnumerable<decimal> list) Source #

Returns the sum total of all the items in the list (Sum in LINQ)

Parameters

param list

List to sum

returns

Sum total

method IEnumerable<T> rev <T> (IEnumerable<T> list) Source #

Reverses the enumerable (Reverse in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to reverse

returns

Reversed enumerable

method Lst<T> rev <T> (Lst<T> list) Source #

Reverses the list (Reverse in LINQ)

Parameters

type T

List item type

param list

List to reverse

returns

Reversed list

method Lst<PredList, T> rev <PredList, T> (Lst<PredList, T> list) Source #

where PredList : struct, Pred<ListInfo>

Reverses the list (Reverse in LINQ)

Parameters

type T

List item type

param list

List to reverse

returns

Reversed list

method Lst<PredList, PredItem, T> rev <PredList, PredItem, T> (Lst<PredList, PredItem, T> list) Source #

where PredList : struct, Pred<ListInfo>
where PredItem : struct, Pred<T>

Reverses the list (Reverse in LINQ)

Parameters

type T

List item type

param list

List to reverse

returns

Reversed list

method IEnumerable<T> append <T> (IEnumerable<T> lhs, IEnumerable<T> rhs) Source #

Concatenate two enumerables (Concat in LINQ)

Parameters

type T

Enumerable item type

param lhs

First enumerable

param rhs

Second enumerable

returns

Concatenated enumerable

method IEnumerable<T> append <T> (IEnumerable<T> x, IEnumerable<IEnumerable<T>> xs) Source #

Concatenate an enumerable and an enumerable of enumerables

Parameters

type T

List item type

param lhs

First list

param rhs

Second list

returns

Concatenated list

method IEnumerable<T> append <T> (params IEnumerable<T>[] lists) Source #

Concatenate N enumerables

Parameters

type T

Enumerable type

param lists

Enumerables to concatenate

returns

A single enumerable with all of the items concatenated

method S fold <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result. (Aggregate in LINQ)

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

returns

Aggregate value

method S foldBack <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

returns

Aggregate value

method S foldWhile <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection whilst the predicate function returns True for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S foldWhile <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation (and whilst the predicate function returns True when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S foldBackWhile <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection (from last element to first) whilst the predicate function returns True for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S foldBackWhile <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an accumulator argument through the computation (and whilst the predicate function returns True when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S foldUntil <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection whilst the predicate function returns False for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S foldUntil <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation (and whilst the predicate function returns False when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method S foldBackUntil <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<T, bool> preditem) Source #

Applies a function 'folder' to each element of the collection (from last element to first) whilst the predicate function returns False for the item being processed, threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param preditem

Predicate function

returns

Aggregate value

method S foldBackUntil <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder, Func<S, bool> predstate) Source #

Applies a function 'folder' to each element of the collection (from last element to first), threading an accumulator argument through the computation (and whilst the predicate function returns False when passed the aggregate state). The fold function takes the state argument, and applies the function 'folder' to it and the first element of the list. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Fold function

param predstate

Predicate function

returns

Aggregate value

method A reduce <A> (IEnumerable<A> list, Func<A, A, A> reducer) Source #

Applies a function to each element of the collection (from first element to last), threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

The enumerable must contain at least one item or an excpetion will be thrown

Parameters

type A

Bound item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Aggregate value

method Option<A> reduceOrNone <A> (IEnumerable<A> list, Func<A, A, A> reducer) Source #

Applies a function to each element of the collection (from first element to last), threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

The enumerable must contain at least one item or None will be returned

Parameters

type A

Bound item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Optional aggregate value

method A reduceBack <A> (IEnumerable<A> list, Func<A, A, A> reducer) Source #

Applies a function to each element of the collection, threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

The enumerable must contain at least one item or an excpetion will be thrown

Parameters

type A

Bound item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Aggregate value

method Option<A> reduceBackOrNone <A> (IEnumerable<A> list, Func<A, A, A> reducer) Source #

Applies a function to each element of the collection, threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result.

The enumerable must contain at least one item or None will be returned

Parameters

type A

Bound item type

param list

Enumerable to reduce

param reducer

Reduce function

returns

Optional aggregate value

method IEnumerable<S> scan <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function to each element of the collection, threading an accumulator argument through the computation. This function takes the state argument, and applies the function to it and the first element of the list. Then, it passes this result into the function along with the second element, and so on. Finally, it returns the list of intermediate results and the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Folding function

returns

Aggregate state

method IEnumerable<S> scanBack <S, T> (IEnumerable<T> list, S state, Func<S, T, S> folder) Source #

Applies a function to each element of the collection (from last element to first), threading an accumulator argument through the computation. This function takes the state argument, and applies the function to it and the first element of the list. Then, it passes this result into the function along with the second element, and so on. Finally, it returns the list of intermediate results and the final result.

Parameters

type S

State type

type T

Enumerable item type

param list

Enumerable to fold

param state

Initial state

param folder

Folding function

returns

Aggregate state

method Option<T> find <T> (IEnumerable<T> list, Func<T, bool> pred) Source #

Returns Some(x) for the first item in the list that matches the predicate provided, None otherwise.

Parameters

type T

Enumerable item type

param list

Enumerable to search

param pred

Predicate

returns

Some(x) for the first item in the list that matches the predicate provided, None otherwise.

method IEnumerable<T> findSeq <T> (IEnumerable<T> list, Func<T, bool> pred) Source #

Returns [x] for the first item in the list that matches the predicate provided, [] otherwise.

Parameters

type T

Enumerable item type

param list

Enumerable to search

param pred

Predicate

returns

[x] for the first item in the list that matches the predicate provided, [] otherwise.

method Lst<T> freeze <T> (IEnumerable<T> list) Source #

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method Lst<PredList, T> freeze <PredList, T> (IEnumerable<T> list) Source #

where PredList : struct, Pred<ListInfo>

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method Lst<PredList, PredItem, T> freeze <PredList, PredItem, T> (IEnumerable<T> list) Source #

where PredItem : struct, Pred<T>
where PredList : struct, Pred<ListInfo>

Convert any enumerable into an immutable Lst T

Parameters

type T

Enumerable item type

param list

Enumerable to convert

returns

Lst of T

method IEnumerable<V> zip <T, U, V> (IEnumerable<T> list, IEnumerable<U> other, Func<T, U, V> zipper) Source #

Joins two enumerables together either into a single enumerable using the join function provided

Parameters

param list

First list to join

param other

Second list to join

param zipper

Join function

returns

Joined enumerable

method IEnumerable<(T Left, U Right)> zip <T, U> (IEnumerable<T> list, IEnumerable<U> other) Source #

Joins two enumerables together either into an enumerables of tuples

Parameters

param list

First list to join

param other

Second list to join

param zipper

Join function

returns

Joined enumerable of tuples

method int length <T> (IEnumerable<T> list) Source #

Returns the number of items in the enumerable

Parameters

type T

Enumerable item type

param list

Enumerable to count

returns

The number of items in the enumerable

method Unit iter <T> (IEnumerable<T> list, Action<T> action) Source #

Invokes an action for each item in the enumerable in order

Parameters

type T

Enumerable item type

param list

Enumerable to iterate

param action

Action to invoke with each item

returns

Unit

method Unit iter <T> (IEnumerable<T> list, Action<int, T> action) Source #

Invokes an action for each item in the enumerable in order and supplies a running index value.

Parameters

type T

Enumerable item type

param list

Enumerable to iterate

param action

Action to invoke with each item

returns

Unit

method Unit consume <T> (IEnumerable<T> list) Source #

Iterate each item in the enumerable in order (consume items)

Parameters

type T

Enumerable item type

param list

Enumerable to consume

returns

Unit

method bool forall <T> (IEnumerable<T> list, Func<T, bool> pred) Source #

Returns true if all items in the enumerable match a predicate (Any in LINQ)

Parameters

type T

Enumerable item type

param list

Enumerable to test

param pred

Predicate

returns

True if all items in the enumerable match the predicate

method IEnumerable<T> distinct <T> (IEnumerable<T> list) Source #

Return a new enumerable with all duplicate values removed

Parameters

type T

Enumerable item type

param list

Enumerable

returns

A new enumerable with all duplicate values removed

method IEnumerable<T> distinct <EQ, T> (IEnumerable<T> list) Source #

where EQ : struct, Eq<T>

Return a new enumerable with all duplicate values removed

Parameters

type T

Enumerable item type

param list

Enumerable

returns

A new enumerable with all duplicate values removed

method IEnumerable<T> distinct <T, K> (IEnumerable<T> list, Func<T, K> keySelector, Option<Func<K, K, bool>> compare = default(Option<Func<K, K, bool>>)) Source #

Return a new enumerable with all duplicate values removed

Parameters

type T

Enumerable item type

param list

Enumerable

returns

A new enumerable with all duplicate values removed

method IEnumerable<T> take <T> (IEnumerable<T> list, int count) Source #

Returns a new enumerable with the first 'count' items from the enumerable provided

Parameters

type T

Enumerable item type

param list

Enumerable

param count

Number of items to take

returns

A new enumerable with the first 'count' items from the enumerable provided

method IEnumerable<T> takeWhile <T> (IEnumerable<T> list, Func<T, bool> pred) Source #

Iterate the list, yielding items if they match the predicate provided, and stopping as soon as one doesn't

Parameters

type T

Enumerable item type

param list

Enumerable

param count

Number of items to take

returns

A new enumerable with the first items that match the predicate

method IEnumerable<T> takeWhile <T> (IEnumerable<T> list, Func<T, int, bool> pred) Source #

Iterate the list, yielding items if they match the predicate provided, and stopping as soon as one doesn't. An index value is also provided to the predicate function.

Parameters

type T

Enumerable item type

param list

Enumerable

param count

Number of items to take

returns

A new enumerable with the first items that match the predicate

method IEnumerable<S> unfold <S> (S state, Func<S, Option<S>> unfolder) Source #

Generate a new list from an intial state value and an 'unfolding' function. The unfold function generates the items in the resulting list until None is returned.

Parameters

type S

State type

param state

Initial state

param unfolder

Unfold function

returns

Unfolded enumerable

method IEnumerable<A> unfold <S, A> (S state, Func<S, Option<(A, S)>> unfolder) Source #

Generate a new list from an intial state value and an 'unfolding' function. An aggregate state value is threaded through separately to the yielded value. The unfold function generates the items in the resulting list until None is returned.

Parameters

type A

Bound value of resulting enumerable

type S

State type

param state

Initial state

param unfolder

Unfold function

returns

Unfolded enumerable

method IEnumerable<A> unfold <S1, S2, A> ((S1, S2) state, Func<S1, S2, Option<(A, S1, S2)>> unfolder) Source #

Generate a new list from an intial state value and an 'unfolding' function. An aggregate state value is threaded through separately to the yielded value. The unfold function generates the items in the resulting list until None is returned.

Parameters

type A

Bound value of resulting enumerable

type S1

State type

type S2

State type

param state

Initial state

param unfolder

Unfold function

returns

Unfolded enumerable

method IEnumerable<A> unfold <S1, S2, S3, A> ((S1, S2, S3) state, Func<S1, S2, S3, Option<(A, S1, S2, S3)>> unfolder) Source #

Generate a new list from an intial state value and an 'unfolding' function. An aggregate state value is threaded through separately to the yielded value. The unfold function generates the items in the resulting list until None is returned.

Parameters

type A

Bound value of resulting enumerable

type S1

State type

type S2

State type

type S3

State type

param state

Initial state

param unfolder

Unfold function

returns

Unfolded enumerable

method IEnumerable<A> unfold <S1, S2, S3, S4, A> ((S1, S2, S3, S4) state, Func<S1, S2, S3, S4, Option<(A, S1, S2, S3, S4)>> unfolder) Source #

Generate a new list from an intial state value and an 'unfolding' function. An aggregate state value is threaded through separately to the yielded value. The unfold function generates the items in the resulting list until None is returned.

Parameters

type A

Bound value of resulting enumerable

type S1

State type

type S2

State type

type S3

State type

type S4

State type

param state

Initial state

param unfolder

Unfold function

returns

Unfolded enumerable

method bool exists <T> (IEnumerable<T> list, Func<T, bool> pred) Source #

Returns true if any item in the enumerable matches the predicate provided

Parameters

type T

Enumerable item type

param list

Enumerable to test

param pred

Predicate

returns

True if any item in the enumerable matches the predicate provided

method Option<T> headSafe <T> (IEnumerable<T> list) Source #

method IEnumerable<B> apply <A, B> (IEnumerable<Func<A, B>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable of argument values

returns

Returns the result of applying the IEnumerable argument values to the IEnumerable functions

method IEnumerable<B> apply <A, B> (Func<A, B> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable of argument values

returns

Returns the result of applying the IEnumerable argument values to the IEnumerable functions

method IEnumerable<Func<B, C>> apply <A, B, C> (IEnumerable<Func<A, B, C>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<Func<B, C>> apply <A, B, C> (Func<A, B, C> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<C> apply <A, B, C> ( IEnumerable<Func<A, B, C>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<C> apply <A, B, C> (Func<A, B, C> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<Func<B, C>> apply <A, B, C> (IEnumerable<Func<A, Func<B, C>>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<Func<B, C>> apply <A, B, C> (Func<A, Func<B, C>> fabc, IEnumerable<A> fa) Source #

Apply an IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

returns

Returns the result of applying the IEnumerable of argument values to the IEnumerable of functions: an IEnumerable of functions of arity 1

method IEnumerable<C> apply <A, B, C> (IEnumerable<Func<A, Func<B, C>>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<C> apply <A, B, C> (Func<A, Func<B, C>> fabc, IEnumerable<A> fa, IEnumerable<B> fb) Source #

Apply IEnumerable of values to an IEnumerable of functions of arity 2

Parameters

param fabc

IEnumerable of functions

param fa

IEnumerable argument values

param fb

IEnumerable argument values

returns

Returns the result of applying the IEnumerables of arguments to the IEnumerable of functions

method IEnumerable<B> action <A, B> (IEnumerable<A> fa, IEnumerable<B> fb) Source #

Evaluate fa, then fb, ignoring the result of fa

Parameters

param fa

Applicative to evaluate first

param fb

Applicative to evaluate second and then return

returns

Applicative of type FB derived from Applicative of B

method IEnumerable<IEnumerable<T>> tails <T> (IEnumerable<T> self) Source #

The tails function returns all final segments of the argument, longest first. For example, i.e. tails(['a','b','c']) == [['a','b','c'], ['b','c'], ['c'],[]]

Parameters

type T

List item type

param self

List

returns

Enumerable of Enumerables of T

method (IEnumerable<T>, IEnumerable<T>) span <T> (IEnumerable<T> self, Func<T, bool> pred) Source #

Span, applied to a predicate 'pred' and a list, returns a tuple where first element is longest prefix (possibly empty) of elements that satisfy 'pred' and second element is the remainder of the list:

Parameters

type T

List element type

param self

List

param pred

Predicate

returns

Split list

Examples

List.span(List(1,2,3,4,1,2,3,4), x => x < 3) == (List(1,2),List(3,4,1,2,3,4))

List.span(List(1,2,3), x => x < 9) == (List(1,2,3),List())

List.span(List(1,2,3), x => x < 0) == (List(),List(1,2,3))

class Lst <PRED, A> Source #

where PRED : struct, Pred<ListInfo>

Immutable list with validation predicate

Parameters

type PRED

Predicate instance to run when the type is constructed

type A

Value type

Indexers

this [ A ] Source #

Index accessor

Properties

property bool IsEmpty Source #

property object Case Source #

Reference version for use in pattern-matching

Empty collection     = null
Singleton collection = A
More                 = (A, Seq<A>)   -- head and tail

var res = list.Case switch
{

   A value         => ...,
   (var x, var xs) => ...,
   _               => ...
}

property int Count Source #

Number of items in the list

Constructors

constructor Lst (IEnumerable<A> initial) Source #

Ctor

Methods

method bool Contains (A value) Source #

Find if a value is in the collection

Parameters

param value

Value to test

returns

True if collection contains value

method bool Contains <EqA> (A value) Source #

where EqA : struct, Eq<A>

Contains with provided Eq class instance

Parameters

type EqA

Eq class instance

param value

Value to test

returns

True if collection contains value

method Lst<PRED, A> Add (A value) Source #

Add an item to the end of the list

method Lst<PRED, A> AddRange (IEnumerable<A> items) Source #

Add a range of items to the end of the list

method IEnumerator<A> GetEnumerator () Source #

Get enumerator

method int IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the index of an item

method Lst<PRED, A> Insert (int index, A value) Source #

Insert value at specified index

method Lst<PRED, A> InsertRange (int index, IEnumerable<A> items) Source #

Insert range of values at specified index

method int LastIndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the last index of an item in the list

method Lst<PRED, A> Remove (A value) Source #

Remove all items that match the value from the list

method Lst<PRED, A> Remove (A value, IEqualityComparer<A> equalityComparer) Source #

Remove all items that match the value from the list

method Lst<PRED, A> RemoveAll (Func<A, bool> pred) Source #

Remove all items that match a predicate

method Lst<PRED, A> RemoveAt (int index) Source #

Remove item at location

Parameters

param index
returns

method Lst<PRED, A> RemoveRange (int index, int count) Source #

Remove a range of items

method Lst<PRED, A> SetItem (int index, A value) Source #

Set an item at the specified index

method IEnumerable<A> FindRange (int index, int count) Source #

Returns an enumerable range from the collection. This is the fastest way of iterating sub-ranges of the collection.

Parameters

param index

Index into the collection

param count

Number of items to find

returns

IEnumerable of items

method Seq<A> ToSeq () Source #

method string ToString () Source #

Format the collection as [a, b, c, ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as a, b, c, ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [a, b, c, ...]

method IEnumerable<A> AsEnumerable () Source #

method IEnumerable<A> Skip (int amount) Source #

method Lst<PRED, A> Reverse () Source #

Reverse the order of the items in the list

method S Fold <S> (S state, Func<S, A, S> folder) Source #

Fold

method Lst<PRED, U> Map <U> (Func<A, U> map) Source #

Map

method Lst<PRED, A> Filter (Func<A, bool> pred) Source #

Filter

method Lst<PRED, A> Append (Lst<PRED, A> rhs) Source #

method Lst<PRED, A> Subtract (Lst<PRED, A> rhs) Source #

method bool Equals (object obj) Source #

method int GetHashCode () Source #

Get the hash code Lazily (and once only) calculates the hash from the elements in the list Empty list hash == 0

method int CompareTo (object obj) Source #

method bool Equals (Lst<PRED, A> other) Source #

method Arr<A> ToArray () Source #

method int CompareTo (Lst<PRED, A> other) Source #

Operators

operator + (Lst<PRED, A> lhs, A rhs) Source #

operator + (A lhs, Lst<PRED, A> rhs) Source #

operator + (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator - (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator == (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator != (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator < (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator <= (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator > (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

operator >= (Lst<PRED, A> lhs, Lst<PRED, A> rhs) Source #

class Lst <PredList, PredItem, A> Source #

where PredList : struct, Pred<ListInfo>
where PredItem : struct, Pred<A>

Immutable list with validation predicate

Parameters

type PredItem

Predicate instance to run when the type is constructed

type A

Value type

Indexers

this [ A ] Source #

Index accessor

Properties

property bool IsEmpty Source #

property object Case Source #

Reference version for use in pattern-matching

Empty collection     = null
Singleton collection = A
More                 = (A, Seq<A>)   -- head and tail

var res = list.Case switch
{

   A value         => ...,
   (var x, var xs) => ...,
   _               => ...
}

property int Count Source #

Number of items in the list

Constructors

constructor Lst (IEnumerable<A> initial) Source #

Ctor

Methods

method bool Contains (A value) Source #

Find if a value is in the collection

Parameters

param value

Value to test

returns

True if collection contains value

method bool Contains <EqA> (A value) Source #

where EqA : struct, Eq<A>

Contains with provided Eq class instance

Parameters

type EqA

Eq class instance

param value

Value to test

returns

True if collection contains value

method Lst<PredList, PredItem, A> Add (A value) Source #

Add an item to the end of the list

method Lst<PredList, PredItem, A> AddRange (IEnumerable<A> items) Source #

Add a range of items to the end of the list

method IEnumerable<A> FindRange (int index, int count) Source #

Returns an enumerable range from the collection. This is the fastest way of iterating sub-ranges of the collection.

Parameters

param index

Index into the collection

param count

Number of items to find

returns

IEnumerable of items

method IEnumerator<A> GetEnumerator () Source #

Get enumerator

method Seq<A> ToSeq () Source #

method string ToString () Source #

Format the collection as [a, b, c, ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as a, b, c, ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [a, b, c, ...]

method IEnumerable<A> AsEnumerable () Source #

method int IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the index of an item

method Lst<PredList, PredItem, A> Insert (int index, A value) Source #

Insert value at specified index

method Lst<PredList, PredItem, A> InsertRange (int index, IEnumerable<A> items) Source #

Insert range of values at specified index

method int LastIndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null) Source #

Find the last index of an item in the list

method Lst<PredList, PredItem, A> Remove (A value) Source #

Remove all items that match the value from the list

method Lst<PredList, PredItem, A> Remove (A value, IEqualityComparer<A> equalityComparer) Source #

Remove all items that match the value from the list

method Lst<PredList, PredItem, A> RemoveAll (Func<A, bool> pred) Source #

Remove all items that match a predicate

method Lst<PredList, PredItem, A> RemoveAt (int index) Source #

Remove item at location

Parameters

param index
returns

method Lst<PredList, PredItem, A> RemoveRange (int index, int count) Source #

Remove a range of items

method Lst<PredList, PredItem, A> SetItem (int index, A value) Source #

Set an item at the specified index

method IEnumerable<A> Skip (int amount) Source #

method Lst<PredList, PredItem, A> Reverse () Source #

Reverse the order of the items in the list

method S Fold <S> (S state, Func<S, A, S> folder) Source #

Fold

method Lst<PredList, PREDU, U> Map <PREDU, U> (Func<A, U> map) Source #

where PREDU : struct, Pred<U>

Map

method Lst<PredList, PredItem, A> Map (Func<A, A> map) Source #

Map

method Lst<PredList, PredItem, A> Filter (Func<A, bool> pred) Source #

Filter

method Lst<PredList, PredItem, A> Append (Lst<PredList, PredItem, A> rhs) Source #

method Lst<PredList, PredItem, A> Subtract (Lst<PredList, PredItem, A> rhs) Source #

method bool Equals (object obj) Source #

method int GetHashCode () Source #

Get the hash code Lazily (and once only) calculates the hash from the elements in the list Empty list hash == 0

method int CompareTo (object obj) Source #

method bool Equals (Lst<PredList, PredItem, A> other) Source #

method Arr<A> ToArray () Source #

method int CompareTo (Lst<PredList, PredItem, A> other) Source #

Operators

operator + (Lst<PredList, PredItem, A> lhs, A rhs) Source #

operator + (A lhs, Lst<PredList, PredItem, A> rhs) Source #

operator + (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator - (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator == (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator != (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator < (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator <= (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator > (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #

operator >= (Lst<PredList, PredItem, A> lhs, Lst<PredList, PredItem, A> rhs) Source #